-
Notifications
You must be signed in to change notification settings - Fork 0
add new modification MoveVoltageLevelFeederBays #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
} | ||
|
||
private void processConnectivityPosition(ConnectablePosition<?> connectablePosition, | ||
public void processConnectivityPosition(ConnectablePosition<?> connectablePosition, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can keep private here :/
|
private String voltageLevelId; | ||
|
||
@Schema(description = "Feeder bays list") | ||
private List<ConnectablePositionModificationInfos> feederBaysAttributeList; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private List<ConnectablePositionModificationInfos> feederBaysAttributeList; | |
private List<ConnectablePositionModificationInfos> feederBays; |
* @author Slimane Amar <slimane.amar at rte-france.com> | ||
*/ | ||
// FIXME : to remove when this class is available in network-store | ||
public class BusbarSectionFinderTraverser implements Terminal.TopologyTraverser { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move those changes in another PR. So the review can be done with gridsuite/network-map-server#288. And the changes in the tests will be reviewed with it
BusbarSectionFinderTraverser connectedBusbarSectionFinder = new BusbarSectionFinderTraverser(terminal.isConnected()); | ||
terminal.traverse(connectedBusbarSectionFinder, TraversalType.BREADTH_FIRST); | ||
return connectedBusbarSectionFinder.getFirstTraversedBbsId(); | ||
BusbarSectionFinderTraverser finder = new BusbarSectionFinderTraverser(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move those changes in another PR. So the review can be done with gridsuite/network-map-server#288. And the changes in the tests will be reviewed with it
network.modification.TotalOutwardHvdcFlow = The HVDC balance is : ${hvdcBalance} MW | ||
network.modification.TwoWindingsTransformerProperties = Properties | ||
network.modification.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION = Voltage Level topology modification ${voltageLevelId} | ||
network.modification.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS = Move voltage level feeder bays modification ${voltageLevelId} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check US specification for logs. That's not what is asked
Generator generator = getNetwork().getGenerator("idGenerator"); | ||
Terminal terminal = generator.getTerminal(); | ||
assertEquals("v2", terminal.getVoltageLevel().getId()); | ||
BusbarSectionFinderTraverser connectedBusbarSectionFinder = new BusbarSectionFinderTraverser(terminal.isConnected()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move those changes in another PR. So the review can be done with gridsuite/network-map-server#288
if (connectable == null) { | ||
throw new NetworkModificationException(MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_ERROR, String.format(CONNECTABLE_NOT_FOUND, info.getEquipmentId())); | ||
} | ||
if (!(connectable instanceof Injection<?>) && !(connectable instanceof Branch<?>)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it excudes 3WT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should rather exclude busbarSection as it is done in MoveFeederBay. Something like :
(connectable instanceof BusbarSection) throw ...
return ModificationType.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS.name(); | ||
} | ||
|
||
private void modifyInjectionConnectablePosition(Network network, Injection<?> injection, ConnectablePositionModificationInfos info, ReportNode subReportNode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modifyInjectionConnectablePosition and modifyBranchConnectablePosition should be one method modifyConnectablePosition().
With a if else for modifyInjectionConnectivityAttributes() and modifyBranchConnectivityAttributes()
private InjectionModificationInfos buildInjectionModificationInfos(ConnectablePositionModificationInfos info) { | ||
InjectionModificationInfos injectionInfos = new InjectionModificationInfos(); | ||
injectionInfos.setEquipmentId(info.getEquipmentId()); | ||
injectionInfos.setConnectionPosition(new AttributeModification<>(info.getConnectionPosition(), OperationType.SET)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those 3 rows can be a method. And the method used here and in buildBranchModificationInfos()
Connectable<?> connectable = network.getConnectable(info.getEquipmentId()); | ||
return switch (connectable) { | ||
case Injection<?> injection -> injection.getTerminal(); | ||
case Branch<?> branch -> getTerminalFromBranch(branch, info); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case Branch<?> branch -> getTerminalFromBranch(branch, info); | |
case Branch<?> branch -> branch.getTerminal(info.getConnectionSide()); |
}; | ||
} | ||
|
||
private Terminal getTerminalFromBranch(Branch<?> branch, ConnectablePositionModificationInfos info) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove method
@Setter | ||
@ToString(callSuper = true) | ||
@Schema(description = "Connectable position modification") | ||
public class ConnectablePositionModificationInfos { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public class ConnectablePositionModificationInfos { | |
public class MoveFeederBayInfos { |
} | ||
|
||
private void modifyInjectionConnectablePosition(Network network, Injection<?> injection, ConnectablePositionModificationInfos info, ReportNode subReportNode) { | ||
ConnectablePosition connectablePosition = injection.getExtension(ConnectablePosition.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConnectablePosition connectablePosition = injection.getExtension(ConnectablePosition.class); | |
ConnectablePosition oldConnectablePosition = injection.getExtension(ConnectablePosition.class); |
return ModificationType.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS.name(); | ||
} | ||
|
||
private void modifyInjectionConnectablePosition(Network network, Injection<?> injection, ConnectablePositionModificationInfos info, ReportNode subReportNode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private void modifyInjectionConnectablePosition(Network network, Injection<?> injection, ConnectablePositionModificationInfos info, ReportNode subReportNode) { | |
private void modifyInjectionConnectablePosition(Network network, Injection<?> injection, ConnectablePositionModificationInfos newConnectablePositionInfos, ReportNode subReportNode) { |
return branchInfos; | ||
} | ||
|
||
private void moveVoltageLevelBusOrBusbarSection(Network network, Connectable<?> connectable, ConnectablePositionModificationInfos info, ReportNode subReportNode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should be named moveFeederBay(). And also modifyVoltageLevelBusOrBusBarSectionAttributes() should be named moveFeederBay(). As the only thing they do is apply moveFeederBay() modfication from powsybl-core.
No description provided.